<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>123</title>
</head>

<body>

	<p> 去重</p>
	<p id="demo"></p>
	<script>

		function quchong(arrList) {
			let arrNew = []
			for (const arr of arrList) {
				if (arrNew.indexOf(arr) == -1) {
					arrNew.push(arr)
				}
			}

			console.log('去重后');
			arrNew.forEach((item, index) => {
				console.log(item);
			})
		}

		// 调用 quchong 方法，并传入一个数组
		const arr = [1, 2, 3, 1, 4, 5, 2, 6, 3];
		quchong(arr);

	</script>

</body>

</html>